package com.gzhu.knowledgeAdmin.controller;


import com.gzhu.knowledgeAdmin.common.result.R;
import com.gzhu.knowledgeAdmin.entity.TBqT;
import com.gzhu.knowledgeAdmin.service.TBqTService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/label")
public class LabelController {

    @Resource
    private TBqTService tBqTService;

    @RequestMapping(value="/pageSearch",method = RequestMethod.POST)
    public R findPageBySearch(@RequestBody TBqT tBqT)
    { return R.ok(tBqTService.selectAllBySearch(tBqT)); }

    @PostMapping("/del/{fId}")
    public R deleteById(@PathVariable Long fId)
    {
        return R.ok(tBqTService.removeById(fId));
    }

    @PostMapping("/add")
    public R addLabel(@RequestBody TBqT tBqT) {
        return R.ok(tBqTService.addLabel(tBqT));
    }

    @PostMapping("/update")
    public R updateTask(@RequestBody TBqT tBqT)
    {
        return R.ok(tBqTService.updateLabel(tBqT));
    }
}
